package com.yky.interceptor;

import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 业务聚合
 *
 * @version [V2.0]
 * @package com.yky.interceptor;
 * @description:[用一句话描述该文件做什么]
 * @author: [zhuben]
 * @date: [2024-02-28 09:16]
 * @copyright: 2024 echovin.com
 */

public class SecurityInterceptor implements HandlerInterceptor {
    private String regex = ".*(css|html|ico|html|jpg|jpeg|png|gif|js|woff|ttf|map|json)";
    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        String url = request.getRequestURL().toString();
        if (url.matches(regex)){
            return true;
        }
        return false;
    }
}
